<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        li {
            list-style: none;
        }

        body {
            background: url(./img/图1.jfif)no-repeat;
        }

        .uu {
            display: flex;
            width: 100px;
            height: 100px;
        }

        img {
            width: 100px;
            height: 100px;
        }
    </style>
</head>

<body>
    <ul class="uu">
        <li><img src="./img/图1.jfif" alt=""></li>
        <li><img src="./img/图2.jfif" alt=""></li>
        <li><img src="./img/图3.jfif" alt=""></li>

    </ul>
    <script>
        var uu1 = document.querySelector('.uu').querySelectorAll('img ')
        // console.log(uu1);
        for (var i = 0; i < uu1.length; i++) {
            uu1[i].onclick = function () {
                // console.log(this.src);
                document.body.style.backgroundImage='url('+this.src+')'
            }
        }

    </script>
</body>

</html>